package com.yue.configs;

import com.yue.bean.UserInfoBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration  // 配置类
@ComponentScan(basePackages = "com.yue") // 注解的扫描范围
public class AppConfig {
    @Bean
    public UserInfoBean provideUserInfoBean() {
        UserInfoBean userInfoBean = new UserInfoBean();
        // 设置初始参数
        userInfoBean.setUserName("小明");

        return userInfoBean;
    }
}
